package cn.wolfcode.p2p.base.domain;

import cn.wolfcode.base.BaseDomain;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Date;

@Getter
@Setter
@Accessors(chain = true)
public class BaseAuditDomain extends BaseDomain {
    public static final int STATE_NORMAL = 0;
    public static final int STATE_PASS = 1;
    public static final int STATE_REJECT = 2;
    /**
     * 审核状态(待审核/通过/拒绝)
     */
    int state = STATE_NORMAL;

    /**
     * 审核备注信息
     */
    String remark;

    /**
     * 审核时间
     */
    Date auditTime;

    /**
     * 申请时间
     */
    Date applyTime;

    /**
     * 审核人ID
     */
    LoginInfo auditor;

    /**
     * 申请人ID
     */
    LoginInfo applier;

    // 审核状态显示
    public String getDisplayState() {
        String temp = "待审核";
        if (this.state == STATE_PASS) {
            temp = "审核通过";
        } else if (this.state == STATE_REJECT) {
            temp = "审核拒绝";
        }
        return temp;
    }

}
